package org.aepscolombia.platform.models.entity;
// Generated Jan 13, 2014 2:36:33 PM by Hibernate Tools 3.2.1.GA


import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * ResidualsClasification generated by hbm2java
 */
@Entity
@Table(name="residuals_clasification"
    ,catalog="madr_bd10"
)
public class ResidualsClasification  implements java.io.Serializable {


     private int idResCla;
     private String nameResCla;
     private boolean statusResCla;
     private Set cropsTypeses = new HashSet(0);
     private Set preparationses = new HashSet(0);

    public ResidualsClasification() {
    }

	
    public ResidualsClasification(int idResCla, String nameResCla, boolean statusResCla) {
        this.idResCla = idResCla;
        this.nameResCla = nameResCla;
        this.statusResCla = statusResCla;
    }
    public ResidualsClasification(int idResCla, String nameResCla, boolean statusResCla, Set cropsTypeses, Set preparationses) {
       this.idResCla = idResCla;
       this.nameResCla = nameResCla;
       this.statusResCla = statusResCla;
       this.cropsTypeses = cropsTypeses;
       this.preparationses = preparationses;
    }
   
     @Id 
    
    @Column(name="id_res_cla", unique=true, nullable=false)
    public int getIdResCla() {
        return this.idResCla;
    }
    
    public void setIdResCla(int idResCla) {
        this.idResCla = idResCla;
    }
    
    @Column(name="name_res_cla", nullable=false, length=45)
    public String getNameResCla() {
        return this.nameResCla;
    }
    
    public void setNameResCla(String nameResCla) {
        this.nameResCla = nameResCla;
    }
    
    @Column(name="status_res_cla", nullable=false)
    public boolean isStatusResCla() {
        return this.statusResCla;
    }
    
    public void setStatusResCla(boolean statusResCla) {
        this.statusResCla = statusResCla;
    }
@ManyToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY)
    @JoinTable(name="residuals_clasifications_crops_types", catalog="madr_bd10", joinColumns = { 
        @JoinColumn(name="id_residuals_cla_cro_typ", nullable=false, updatable=false) }, inverseJoinColumns = { 
        @JoinColumn(name="id_crop_type_cro_typ", nullable=false, updatable=false) })
    public Set getCropsTypeses() {
        return this.cropsTypeses;
    }
    
    public void setCropsTypeses(Set cropsTypeses) {
        this.cropsTypeses = cropsTypeses;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="residualsClasification")
    public Set getPreparationses() {
        return this.preparationses;
    }
    
    public void setPreparationses(Set preparationses) {
        this.preparationses = preparationses;
    }




}


